package com.software.loginregister.api;

import com.software.loginregister.entity.NotificationItem;
import com.software.loginregister.entity.Result;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface NotificationApi {
    @GET("/api/notifications/list")  // 添加 /api 前缀
    Call<Result<List<NotificationItem>>> getNotifications(
            @Query("userId") Long userId,
            @Query("type") String type,
            @Query("onlyUnread") Boolean onlyUnread
    );

    @POST("/api/notifications/{notificationId}/read")  // 添加 /api 前缀
    Call<Result<Void>> markNotificationAsRead(
            @Path("notificationId") Long notificationId,
            @Query("userId") Long userId
    );

    @POST("/api/notifications/read-all")  // 添加 /api 前缀
    Call<Result<Void>> markAllNotificationsAsRead(
            @Query("userId") Long userId
    );
    @DELETE("/api/notifications/{id}")
    Call<Result<Void>> deleteNotification(
            @Path("id") Long id,
            @Query("userId") Long userId
    );

    @DELETE("/api/notifications/delete-all")
    Call<Result<Void>> deleteAllNotifications(
            @Query("userId") Long userId
    );
}
